//
//  ObjParse.m
//  OpenGLES
//
//  Created by tianhj on 2018/6/5.
//  Copyright © 2018年 tianhj. All rights reserved.
//
#include <stdlib.h>
#import "ObjParse.h"

@interface ObjParse()
{
    long long _vertextSize;
}
@end

@implementation ObjParse
- (instancetype)initWithFileName:(NSString *)fileName
{
    self = [super init];
    if(self)
    {
        _vertextSize = 10;
        _vertextArray = (void *)malloc(sizeof(float)*10);
        NSString *filePath = [[NSBundle mainBundle] pathForResource:fileName ofType:nil];
        NSData *data = [NSData dataWithContentsOfFile:filePath];
        NSString *vertexs = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
        NSArray *vertexCoordinate = [vertexs componentsSeparatedByString:@"\n"];
        [self parseVertex:vertexCoordinate];
    }
    return self;
}

- (void)parseVertex:(NSArray *)vertex
{
    
}
@end
